Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

200 Posts

Post

Replies

Boosts

Views

Activity

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
9.1k
May ’24
Crashing build when testing my app
The Test target not build for not such file or directory: 'CoreGraphics'. Not sure why I get this error, but I configured the target without forgetting the variables BUNDLE_LOADER with $(BUILT_PRODUCTS_DIR)/MyExistingApp.app/MyExistingApp value and TEST_HOST with $(BUNDLE_LOADER) value. App target (not the test target), the Symbols Hidden by Default build setting its equal to NO, unlike the Test target that is set to YES. Any variable more for this? I'm not sure if I should take anything into account when using Xcode 26.1.1 and Swift Testing framework.
0
0
12
1h
Code Coverage Not Accurate in Xcode 26
Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions. In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%. Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report? Environment: Xcode 26 iOS 18 SDK Unit tests running under XCTest Any insights or suggestions would be appreciated.
1
3
106
1h
UNNotificationServiceExtension Not Displaying Sender Image
I created a Notification Service Extension to display profile images in place for the app image (i.e. iMessage). I send a remote push notification via Firebase Functions, and in the payload, the relevant profile image url string. The profile image url string in the payload is successfully delivered as it appears in my console log and AppDelegate didReceiveRemoteNotification function. My problem is the profile image does not replace the default app icon image in the remote push notification. Below is my configuration. Any guidance would be appreciated! Main target app: the info plist contains NSUSerActivityTypes = [INSendMessageIntent]. The Communications Notifications capability is enabled and "Copy only when installing" in Build Phases Embed Foundation Extensions Notification Service Extension plist: contains NSExtension > NSExtensionAttributes > IntentsSupported > INSendMessageIntent. Notification Service Extension class code: var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) guard var bestAttemptContent = bestAttemptContent else { return } guard let fcmOptions = bestAttemptContent.userInfo["fcm_options"] as? [String: Any], let attachmentUrlAsString = fcmOptions["imageURL"] as? String else { contentHandler(bestAttemptContent) return } if let attachmentUrl = URL(string: attachmentUrlAsString) { var senderNameComponents = PersonNameComponents() senderNameComponents.nickname = bestAttemptContent.title let profileImage = INImage(url: attachmentUrl) let sender = INPerson(personHandle: INPersonHandle(value: "1233211234", type: .unknown), nameComponents: senderNameComponents, displayName: bestAttemptContent.title, image: profileImage, contactIdentifier: nil, customIdentifier: nil, isMe: false) let receiver = INPerson(personHandle: INPersonHandle(value: "1233211234", type: .unknown), nameComponents: nil, displayName: nil, image: nil, contactIdentifier: nil, customIdentifier: nil, isMe: true) let intent = INSendMessageIntent( recipients: [receiver], outgoingMessageType: .outgoingMessageText, content: "Test", speakableGroupName: INSpeakableString(spokenPhrase: "Sender Name"), conversationIdentifier: "sampleConversationIdentifier", serviceName: nil, sender: sender, attachments: nil ) intent.setImage(profileImage, forParameterNamed: \.sender) let interaction = INInteraction(intent: intent, response: nil) interaction.direction = .incoming interaction.donate(completion: nil) if #available(iOSApplicationExtension 15.0, *) { do { bestAttemptContent = try bestAttemptContent.updating(from: intent) as! UNMutableNotificationContent } catch { contentHandler(bestAttemptContent) return } } contentHandler(bestAttemptContent) } else { contentHandler(bestAttemptContent) return } } }
1
0
915
12h
Unable to find identity (but have private key and certificate)
I'm unable to sign the an example application using xcode and "automatically manage signing". The error I'm getting is: CodeSign [...] (in target 'foobar' from project 'foobar') Signing Identity: "Apple Development: [xxxx] " /usr/bin/codesign --force --sign 4ABB258102FF656E9F597546A49274C28D2B8B3E -o runtime --timestamp\=none --generate-entitlement-der [filename] 4ABB258102FF656E9F597546A49274C28D2B8B3E: no identity found Command CodeSign failed with a nonzero exit code However, I am able to see a certificate and a private identity on my keychain: % security find-certificate -aZ | grep -i 4ABB258102FF656E9F597546A49274C28D2B8B3E SHA-1 hash: 4ABB258102FF656E9F597546A49274C28D2B8B3E and % security find-key -s | grep -q 'Apple Development' && echo YES YES what is puzzling is that security does not find an identity: % security find-identity -p codesigning Policy: Code Signing Matching identities 0 identities found Valid identities only 0 valid identities found but XCode claims that everything is working fine. Anybody knows what might I be missing? I tried logging out, requesting new certificates, rebooting, moving them to another keychain, and asking to developer friends.
7
0
716
16h
Why are our macOS builds in Xcode Cloud hanging at the “Archive” stage?
Hello, We are experiencing a persistent issue where macOS builds in Xcode Cloud consistently hang at the Archive stage. The build itself completes successfully, but no artifacts appear, and it seems the build gets stuck during artifact upload. These builds remain in this state for several days (currently 3 days and counting) not failing, but never finishing. We opened a support ticket (102756662562), but we have not received any response yet. We rely on Xcode Cloud for our entire CI/CD pipeline, and at the moment our workflow is completely blocked because of this issue. Has anyone encountered something similar or found a workaround? Thank you.
2
2
72
18h
Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
I’m building a React Native 0.72.10 iOS app and hitting build errors. Environment: macOS: Apple M4, Sequoia 15.7.2 Xcode: 26.1.1 React Native: 0.72.10 Errors: Could not delete /Users/.../ios/build because it was not created by the build system Unable to write file '/Users/.../ios/build/Pods.build/Debug-iphonesimulator/...': Operation not permitted (Multiple Pods / React Native framework headers affected) What I’ve tried: bash rm -rf ios/build rm -rf ~/Library/Developer/Xcode/DerivedData xattr -w com.apple.xcode.CreatedByBuildSystem true ios/build pod deintegrate && pod install sudo chown -R $(whoami) ios/build Observations: ios/build is recreated automatically. Some files have com.apple.xcode.CreatedByBuildSystem: true. 3.Xcode have Full disk access authorisation. Why does Xcode fail to delete / write to ios/build even though it’s recreated automatically by the build system? Is this caused by Xcode itself, macOS permissions? Any recommended fix or workaround for these “Operation not permitted” errors?
1
0
30
20h
Xcode can't view code generated by Swift Package Plugins
When using a Swift Build Plugin, the generated code definitions are available through autocomplete, but it is currently not possible to view them directly in Xcode using Option+click. An example of such a plugin is swift-openapi-generator. According to information from "Meet Swift Package plugins" from WWDC22 the generated code is stored with other build artifacts. It would be immensely helpful if there was support for viewing these intermediate files in read-only mode using Option+click. Currently, I have to resort to opening these files through Finder, or opening the project in VS Code where viewing the generated files using Cmd+click works without a problem. Am I missing something? If not, it seems like a big oversight that this is not supported to the same extent in Apple's own tools.
1
0
32
23h
Huge discrepency of predictions confidence between from Pytorch to Coreml example
I am follwing this tutorial: https://apple.github.io/coremltools/docs-guides/source/convert-a-torchvision-model-from-pytorch.html I have obtained simialr result using the python code. However when I view it in Xcode, the preview prediction percentage confidence is way off I suspect it is due the the output of the model, which is in percentage already and in Xcode it multiply 100 again leading to this result. Please give me any feedback to fix this, thank you.
0
0
82
1d
Static library produced by Xcode 26 causes link error on Xcode 16
When a static library is built with Xcode 26 (with deployment target set to iOS 13) and then linked into an app project compiled with Xcode 16, the build process fails with the following linker error: Undefined symbols for architecture arm64: "_swift_coroFrameAlloc" This occurs even though both the static library and the app project have their deployment targets set to iOS 13.0. The static library works on Xcode 26, but fails to link on Xcode 16. This issue shows up with certain Swift syntax. For example, in my case, using a property getter and setter caused the compiler to emit a reference to _swift_coroFrameAlloc, which in turn triggered the issue. This issue prevents us from distributing pre-built static libraries compiled with Xcode 26 to teammates who are still using Xcode 16. I’ve filed feedback for this issue (FB21130604). Is there any way to work around it? For example, by adding specific Build Settings or something similar? A demo project is available here: https://github.com/Naituw/SwiftLibraryDeploymentTargetIssue The demo project includes: StaticLibraryProject: A simple Swift static library with property getter setter usage AppProject: An iOS app that links against the static library verify_compatibility.sh: An automated script to reproduce the issue Method 1: Manual Build and Verification Open StaticLibraryProject/StaticLibraryProject.xcodeproj in Xcode 26 Build the StaticLibraryProject for iOS device (Release configuration) Locate the built libStaticLibraryProject.a in the build products directory Copy libStaticLibraryProject.a to AppProject/AppProject/ directory Open AppProject/AppProject.xcodeproj in Xcode 16 Build the AppProject for iOS device Method 2: Automated Script Edit verify_compatibility.sh to configure the paths to your Xcode installations: Set XCODE_26_PATH to your Xcode 26 installation path (e.g., /Applications/Xcode.app) Set XCODE_16_PATH to your Xcode 16 installation path (e.g., /Applications/Xcode16.app) Run the script: ./verify_compatibility.sh
2
0
148
1d
Assets duplicating on Xcode 26.1 Beta 3
I've recently installed 26.1 Beta 3 alongside stable 26.0.1 When building my app with 26.0.1 the final .ipa size is ~17mb, however after building my app with 26.1 Beta 3 the size has increased up to ~22mb The main difference is Assets.car blowing from 1.1mb to 5.6mb (or 8.6mb if I include all icons settings). Upon examining I've found new liquid glass .icon file duplicating itself multiple times as png variants (any, dark, tinted, etc). Is anyone else experiencing this issue?
7
1
362
1d
DeclaredAgeRange framework new cases and properties cause runtime crash with missing symbol
I'm making a wrapper library to abstract away some of the 'missing platform support' of DeclaredAgeRange until hopefully it expands to additional platforms. When I'm trying to fully enumerate all of the cases of AgeRangeDeclaration, which they all state available starting 26.0 (mysteriously added in Xcode 26.2 beta), the app crashes due to a missing symbol at launch time. This happens both for Xcode 26.1, 26.2 beta 2, and matching Xcode Cloud builds. So I've isolated it beyond "doesn't work on my machine". I just made a handful of crashes and attached a sysdiagnose to a fresh feedback. FB21121092 - DeclaredAgeRange: Eligibility property and new declaration cases unavailable on iOS 26.1 device contradicting documentation - causes runtime symbol not found crash If anyone is curious what these crashes look like I've attached the DiagnosticPayload.jsonRepresentation() generated from one of my favorite frameworks, MetricKit. Very clearly articulated in the diagnostic metadata you can see the symbol not found. "diagnosticMetaData" : { "platformArchitecture" : "arm64e", "terminationReason" : "Symbol not found: _$s16DeclaredAgeRange0bC7ServiceV0bC11DeclarationO14paymentCheckedyA2EmFWC\nReferenced from: <1894EDCB-3263-3604-8938-97D465FF3720> \/Volumes\/VOLUME\/*\/PerformanceOrganizer.app\/PerformanceOrganizer\nExpected in: <B8FD2C23-0CC9-3D94-902D-875900307A7A> \/System\/Library\/Frameworks\/DeclaredAgeRange.framework\/DeclaredAgeRange", "exceptionType" : 10, "appBuildVersion" : "745", "isTestFlightApp" : true, "osVersion" : "iPhone OS 26.1 (23B85)", "bundleIdentifier" : "dev.twincitiesapp.performanceorganizer", "deviceType" : "iPhone18,1", "exceptionCode" : 0, "signal" : 6, "regionFormat" : "US", "appVersion" : "2.0.0", "pid" : 22987, "lowPowerModeEnabled" : false } DiagnosticPayload.json This is the offending code in a type I control and make available on other platforms but leave unused. extension AgeRangeDeclaration { // A factory or initializer that takes the AgeRangeService.AgeRangeDeclaration and maps to the common AgeRangeDeclaration type public init?(platform value: AgeRangeService.AgeRangeDeclaration?) { guard let value else { return nil } switch value { // Xcode 26.1 visible cases case .selfDeclared: self = .selfDeclared case .guardianDeclared: self = .guardianDeclared // Xcode 26.2 visible cases // This is the first culprit, all of the following symbols would crash, this is just the first case .checkedByOtherMethod: self = .checkedByOtherMethod case .guardianCheckedByOtherMethod: self = .guardianCheckedByOtherMethod case .governmentIDChecked: self = .governmentIDChecked case .guardianGovernmentIDChecked: self = .guardianGovernmentIDChecked case .paymentChecked: self = .paymentChecked case .guardianPaymentChecked: self = .guardianPaymentChecked @unknown default: // Apple added new cases in Xcode 26.2 betas that were available in iOS 26.0, // so it is probable that this could happen again. If it does, assert to let developers // bring it to my attention. assertionFailure("Invalid or out of date knowledge of age range declaration \(value)") self = .unknown } } } For what it is worth, the same is also true for isEligibleForAgeFeatures which I suspect was also added to Xcode 26.2 somehow but not made available to real devices running [26.0 - 26.2). As a side note, thank you for this property, it will let me check what states I need to perform extra checks for in a clean way, I just will need it to now not crash my app on 26.0 and 26.1 runtime devices. :) Edit: DTS did confirm on a comment I had in another thread that this is a bug. Now just to wait for an Xcode beta update. https://developer.apple.com/forums/thread/807906?answerId=867205022#867205022 In any case, this is a great example of how MetricKit totally rocks capturing things other off the shelf crash tools might not have a chance to get. I did have to roll back my TestFlight to an earlier build, but MetricKit was there to send me the previous crashes as soon as the app could launch. Thanks MetricKit team!
0
0
81
3d
Xcode 26.1 / OS 26.1 regression with schema and macros
After Xcode 26.1 was updated and installing the OS 26.1 simulators, my app started crashing related to transformable properties. When I checked my schema, I noticed that properties with array collection types are suddenly set with an option transformable with Optional("NSSecureUnarchiveFromData")], even though I do not use any transformable types. I verified the macros, no transformable was specified. This is causing ModelCoders to encode/decode my properties incorrectly. This is not an issue when I switch back to OS 26.0 simulators.
3
0
164
3d
Xcode Cloud, Bitbucket
Hello, While setting up Xcode Cloud using Bitbucket, I encountered an issue with Source Control and providing access to the repository. The problem most likely stems from the fact that Bitbucket has updated its policy, and the use of app passwords is no longer available (at least for new ones). However, in Xcode → Settings → Source Control, the login flow still requires an app password, which makes it impossible to authenticate using the new API tokens. Attempting to authenticate via SSH also does not resolve the issue. After connecting to GitHub, I also tried to connect through the web version, but I'm getting the same message: "Bitbucket Cloud installation was incomplete." I received this same message when I first tried to connect through Xcode. This problem does not occur when connecting to GitHub. I would appreciate receiving feedback from the Apple team on this issue. System Info: Xcode: 16.2 (latest from App Store) macOS: Sequoia 15.1
1
0
101
3d
LLDB and environment variables in Xcode
Hey! I am writing type formatting scripts in Python for lldb, as described in https://lldb.llvm.org/use/variable.html#python-scripting. I'm trying to pass an environment variable to lldb from Xcode to determine the path to the scripts in the project root, so the project is not bound to some predetermined path. I am having trouble doing this in Xcode. What I have tried: lldbinit file Create a .lldbinit file in $(SRCROOT) with the following content: platform shell echo $SRCROOT. Set the path to the .lldbinit file in Edit Scheme... > Info > LLDB Init File ($(SRCROOT)/.lldbinit). Set the SRCROOT environment variable to $(SRCROOT) in Edit Scheme... > Arguments > Environment Variables. entry-point breakpoint Add a breakpoint to the entry-point of the application. Set the Automatically continue after evaluating actions option. Add the action platform shell $(SRCROOT) or platform shell $SRCROOT. Set the SRCROOT environment variable to $(SRCROOT) in Edit Scheme... > Arguments > Environment Variables. What I expect to happen: The first line of the debug console is a path pointing to $(SRCROOT) What actually happens: No path is output Is this functionality available in Xcode Version 26.0.1 (17A400)? Thanks in advance, Barnabas
3
0
156
4d
Mac Catalyst: AUv3 Extension no longer works on MacOS, still works on iOS
I have a Catalyst app ('container') which hosts an embedded AUv3 Audio Unit extension ('plugin'). This used to work for years and has worked with this project until a few days ago. it still works on iOS as expected on MacOS the extension is never registered/installed and won't load extension won't show up with AUVal seems to have stopped working with the 26.1 XCode update I'm fairly certain the problem is not code related (i.e. likely build settings, project settings, entitlements, signing, etc.) I have compared all settings with another still-working project and can't find any meaningful difference (I can't request code-level support because even the minimal thing vastly exceeds the 250 lines of code limit.) How can I debug the issue? I literally don't know where to start to fix this problem, short of rebuilding the entire thing and hope that it magically starts working again.
0
0
99
4d